<?php
	defined( '_JEXEC' ) or die( 'Restricted access' );
	jimport('joomla.application.component.view');
	class SocialRoutesViewSearchForm extends JView
	{
		var $_option = null;
		
		function display($tpl = null)
		{
			$option=JRequest::getCmd('option');
			
			$this->assignRef('option', $option);
			
			$this->addCSS();
			
			$this->addJavascripts();
			
			parent::display($tpl);
		}
		
		private function addCSS(){
			$option=JRequest::getCmd('option');
			
			$document = &JFactory::getDocument();
			$document->addStyleSheet('components'.DS.$option.DS.'css'.DS.'socialroutes.css');
		}
		
		private function addJavascripts(){
			$option=JRequest::getCmd('option');
			
			JHTML::_('behavior.mootools');
			$document = &JFactory::getDocument();
			$document->addScript( 'http://maps.google.com/maps/api/js?sensor=false' );
			$document->addScript( 'components'.DS.$option.DS.'js'.DS.'jquery-1.5.1.min.js' );
			$document->addScript( 'components'.DS.$option.DS.'js'.DS.'routeCommons.js' );
			$document->addScript( 'components'.DS.$option.DS.'js'.DS.'distanceWidget.js' );
			$document->addScript( 'components'.DS.$option.DS.'js'.DS.'searchRoutes.js' );
			$js = 'window.addEvent(\'load\', initFunction);';
			$document->addScriptDeclaration($js);
		}
	}
?>